<template>
  <div class="next-acticle-box" @click="toDetail" v-if="data.uuid">
    <div class="header">
      下一篇
      <div class="icon"></div>
    </div>
    <div class="acticle-box">
      <div class="title">{{data.title}}</div>
      <div class="content">{{data.content}}</div>
      <div class="date">{{data.date}}</div>
    </div>
  </div> 
</template>

<script>
export default {
  props: {
    data: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  methods: {
    toDetail() {
      this.$router.push({name: 'InformationDetail', query: {uuid: this.data.uuid}});
    }
  }
}
</script>

<style lang="scss" scoped>
.next-acticle-box {
  width: 340px;
  background: #F9F9F9;
  margin-top: 52px;
  margin-bottom: 60px;
  cursor: pointer;
  .header {
    position: relative;
    height: 64px;
    padding: 20px 28px 20px 20px;
    box-sizing: border-box;
    font-size: 16px;
    font-family: PingFangSC-Semibold, PingFang SC;
    font-weight: 600;
    color: #5F6670;
    line-height: 24px;
    border-bottom: 1px solid #D8D8D8;
    &::after {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 4px;
      background: #F96868;
      content: '';
    }
    .icon {
      width: 24px;
      height: 24px;
      float: right;
      background: url('../../assets/next_icon.png') no-repeat;
      background-size: cover;
    }
  }
  .acticle-box {
    padding: 20px;
    .title {
      font-size: 20px;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #272727;
      line-height: 30px;
      margin-bottom: 12px;
    }
    .content {
      font-size: 14px;
      
      font-weight: 400;
      color: #4C4C4C;
      line-height: 20px;
      margin-bottom: 12px;
    }
    .date {
      font-size: 14px;
      
      font-weight: 400;
      color: #A8A8A8;
      line-height: 20px;
    }
  }
}
</style>